<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>What is zhis sha?</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-red/easyui.css">

<style type="text/css">

</style>
<script type="text/javascript">

</script> 
</head>
<body>
   <script type="text/javascript">
		$(function(){
			//初始化表格
			$('#yitongguo').datagrid({
			    url:'alreadyplancx',
			    columns:[[
					{field:'DEPTNAME',width:2,title:'需求申请部门',align:'center'},
					{field:'EMPNAME',width:2,title:'申请人',align:'center'},
					{field:'POTZW',width:2,title:'需求职位',align:'center'},
					{field:'ALTNUM',width:2,title:'需求人数',align:'center'},
					{field:'JNXXNAME',width:2,title:'技术要求',align:'center'},
					{field:'ALTFW',width:2,title:'对内/对外',align:'center'},
					{field:'ALTSTAT',width:2,title:'状态',align:'center',
						formatter:function(value){
							if(value==2){
								return "已通过"
							}else{
								return "错误状态"
							}
						}
					},
					{field:'caozuo',width:3,title:'操作',align:'center',
						formatter: function (value, row, index) {
			            return "<span onclick='dahui()'>打回申请</span>\/<span onclick='jiaru()'>加入招聘计划</span>";
			            } 
					}
			    ]],
			    pagination:true,
			    pageNumber:1,
			    pageSize:10,
			    pageList:[10,20,30]
			});
			$("#anniu_sousuo").click(function(){
				var sskuang=$("#kuang_sousuos").val();
				$("#yitongguo").datagrid('load',{
					w:sskuang
				})				
			});
		});
		//打回申请
	    function dahui(){
			var rows=$("#yitongguo").datagrid("getChecked");
			alert(rows[0].ALTID);
			$.ajax({
				type:"post",
				url:"dahuiwaltes",
				data:{dahuiwaltes:rows[0].ALTID},
				success:function(){
					$("#yitongguo").datagrid();
				}
			});
		}
		//招聘申请中
		function jiaru(){
			var rows=$("#yitongguo").datagrid("getChecked");
			alert(rows[0].ALTID);
			$.ajax({
				type:"post",
				url:"yitouguoes",
				data:{yitouguowalt:rows[0].ALTID},
				success:function(){
					$("#yitongguo").datagrid();
				}
			});
		}
	</script>
    <div class="alreadyplanbox">
       <div class="topbox">
           <div class="sousuobox">
                 <input type="text" id="kuang_sousuos" placeholder="请输入部门" style="width:180px;height:30px;font-size:20px;">
                 <input type="button" id="anniu_sousuo" value="搜索"  class="sousuoan">
           </div>
       </div>
       <div class="biaobox">
           <table id="yitongguo" class="easyui-datagrid"
            data-options="width:1000,fitColumns:true,height:450,singleSelect: true">
           </table>
       </div>
       <div id="shenqing_dahui" class="easyui-window" title="否决申请" style="width:390px;height:240px" data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
	       <div>确认是否打回该申请</div>
	       <div><input type="button" value="确定"><input type="button" value="取消"></div>
	   </div>
    </div>
</body>
</html>